Fix the SQL scripts