Set correct length and content type