Fixed error handling for async functions
Reviewed unit tests for full code coverage