Correct the remaining case by using instanceof.