Added checking of port argument