Fix where it would sometimes fail to load repo data

This was uncommitted code I found lingering.
I changed this because in some cases it would not correctly load repo data. TBH I can't remember the exact circumstances.