improvements and bugfixes