better testing, small bugfixes