Fixed bug with switch.