Fixed taskID saving on exit.