Fix the bugged sql-script