More tweaks and bugfixes