several small bugfixes