Improve list command: properly detect disabled loops