Fixed bug where program would not connect to port