a few tweaks and bugfixes