Added case expression type check