Made sure state is AS_DONE and doneReason is only AS_DONE_ERROR on error.

Currently the state will be AS_STOPPED and the doneReason could return AS_DONE_ERROR if an error had occurred in the past.
Merge pull request #31 from Bo98/error-state-fix

Small error state fix