minor function corrections