Fixed global sorting of tickets (closes #262)