A few tweaks and bugfixes