Fix sort of purchases