minor bugfixes and comments