Fixed the missing duplicate issue.

My compare extension was not of the right class. Switched to a a List, which can handle multiple keys having the same value.
Cleaned the code a bit.