Fixing initialization of waitingForHeader.
Fixing doc comments, creating event subscriber for error reporting.