Added check for duplicates when reading constraints.