Implemented content length calculation methods
Improved and fixed errors