Minor changes and add of the check.sql query file