improved port selection on ENV, improved resetClink to handle strings