Normalize port numbers correctly