fixes + test cases