smaller bugfixes and improvements