Fix switch command not throwing error (Fix #4)