Fixed misprint in port calculation.