Better patching, new test cases