Refactor: Unindent various code blocks.
When we have a condition with a bunch of code under it, these can often
be rewritten to invert the condition and exit which allows all the
previously indented code to be un-indented. This can make the resulting
code easier to follow.
I haven't changed every single one of these in ticket.c, only the spots
that I think makes it easier to see what's going on.