Fixed several bugs in ticket transfer code.