Fix broken transactions when generating a ticket.

Fixes #6