Fix a bug when listing all refs