Small improvements and bugfixes