Fix validation of switch