Various small bugfixes.