Bugs.

See commit list, all tiny bugfixes.