Fixes to SQL file