pep8 fix and s/type/content_type to deal with accidental shadowing of a built-in