clean up code for the feature that selects a random port everytime the system restarts

...set every time a setting is saved.