Added integrity checks