some bugfixes for issues created by refactoring...