Fixed bug with setting TCP port

Bug fix.