Fix small data races
Handle and indicate duplicate repo ID:s (fixes #153)