untested switch logic fixes