Small error state fix

Made sure state is AS_DONE and doneReason is only AS_DONE_ERROR when the state is AS_DONE.

Currently the state would be AS_STOPPED and the doneReason could have returned AS_DONE_ERROR if an error had occurred in the past.