Fix issues where stock count does not update correctly after payment failure or order deletion.