Fixed bug when deleting orders.