Smaller improvements and bugfixes