minor changes, some bugfixes and improvements