[Branch ~dhis2-devs-core/dhis2/trunk] Rev 50: Improved data integrity checks.