Fix broken duplicate check for adding new libraries to the data structure.