Ensure port number is not NaN