Add comment to explain what -z is
Clean up the option parsing code
Fix sscanf for parsing -p. Add regression test.