Fixed bug with finding ports.