Correct istype optimization.