Fix problem with duplicated entries in generated SQL scripts.