Revert "minor bug fixes, final commit"

This reverts commit d47299089719d4b1518fd7097701c327abb0cf1f.