Small fixes

Just a few small bugfixes.