some small bugfixes and improvements