Corrected bug in sorting the package.order.