A few random bugfixes.