Bugfix for switch statements