Added type checks for switch and case.