various small bugfixes