bugfixes, and forgotten file in commit