Raise and error if network source has an invalid port.

Fixed #125.