further bugfixes and tweaks