Improved task queue handling for analysis