Bugfix. Queue wasn't being cleared when processing was cancelled.
Cleanup process moved into a cleanup() function (both pass or fail)