Content length is managed internally as a long. Fix a few places that were unnecessarily restricting it to an int.