Added error types, waitChan, and refactored dispatch and manager structure