Fixed variable typo in switch statement

First time forking, hopefully more changes to come :)