Fixes some test cases issues