Small improvements and bugfixes.