port numbering bug fix

fixes #312