Implemented better support for keep-alive.
Fixed headers cleanup after completed request.