port number handling improved
port number tests added