Fix #110: incorrect optimization in switch block