Revert "minor bug fixes"

This reverts commit 56c55adba118b309456fc9148a230ef3dd88aae5.