Minor bugfixes and comments