Make repo checking more robust