Fixed bug where content length wasn't being set