small bugfixe & add test cases