small bugfixes/cleanup