Tasks may have been added to the flushQueue while flushing, so making sure flush those as well in _fireTasksFlushEvents before calling _flushQueuedTasks.