fix poor if/switch translation

should fix #4