Check if dist port is available since otherwise we will create a horrific error message. Also refactor a touch.