test cases and fixes to make them pass