Assorted small bugfixes.