cleanup, small bugfixes