Rationalised port ordering.
Fixed port bug.