Model validation: added missing (unused, but we want to be complete) inconsistency errors, added comments and reformatted code a bit.