Fix list command not processing main with multiple files, closes #660.