Error handling bug fix
Modify end() method to only resolve once close event has been raised
Add error listener to each individual promise to ensure any errors emitted during the promise result in the promise being rejected
Modify end() method to only resolve once close event has been raised
Add error listener to each individual promise to ensure any errors emitted during the promise result in the promise being rejected