Small tweaks and bugfixes