Some small bugfixes