No need to set Content-Length header.

If you omit the response will be sent in chunked encoding.
Fix deprecated, unchecked and feature warnings.