Fix test cases for issue 9892 and 6795