Fix bug in selecting repositories + improve diagnostic messages