Added lots of checks looking for inconsistent references between the various objects, mainly revisions.