Added a bunch of sanity checks for contenttypes. Fixes #285, fixes #286.