Fix switch usage issues