Fix several test cases