Fixed the bug where the same dependencies would be found more than once.