fixes to the sql file and schema