Fixed: errors in detecting PG duplicates.