diverse bugfixes from testing