Fix instance check in test_case