Minor improvements and bugfixes.