Fixed switch statement logic