bugfixes and improvements
merge