minor bugfixes and improvements
