small bugfixes and extra tests