fixes to make test cases pass