small bugfixes and extended tests