Partially fixed multiple MySQL statements. PgSQL class improved.