Fixed switch statement problem, added break statements