Fixed the port bug slightly more elegantly.
Merge branch 'autorouter_port'