various tweaks and bugfixes