Fix switch using strings

Fix error in #479