Change so can set port from command line
Fix bug