More data integrity checks and tests for them.