Various minor bugfixes.