Extracted min and max allowed port values into named constants
Some small fixes