Tighten up checks on port ranges and path character sets.