Minor tweaks and bugfixes