small bugfixes, needs more work