r288: combination of BUG 1081 and patch from J. Klinger -- added remove_duplicate_gid...