Fix a crash lowering ports
Improve generation of size lists