minor bug fixes

all bugs were caused by the refactoring