polish and bugfixes