Validate port range, closes #278