Fix instanceof handling.