Added close and start helpers with port scanning to avoid uncaught exception on start