Added missing semicolons and 'IF NOT EXISTS'