small bugfixes and improvements