minor bugfixes after code reorganization