More sensible way to handle content type checking.
Merge branch 'facebook_fix' into facebookfix