Fixed the OpenPort Method

I sorta made a dummy mistake, and did an if else if statement, which put
it in an invalid loop momentarily. But I changed it to a switch
statement, and it works properly now.