Some more cleanups and making the content-type override work the correct way