Built more data integrity and table structure checks (not fully tested)