- [CFO] we should not set cancel on control unload or on CloseCurrentTask() since this can cause a unfinished file lost

- [CFO] some reordering and fixes