Fix the dequeue mechanism.
Merge branch 'feature/fix-deferred-exec' into develop