Stylistic cleanup.
Use macro to avoid repeating tedious matching.
Print reasoning behind IP and port parse failures.