Fix switch logic.