Fix overflow in port command which led to an assertion failure.