fixes and testcase