List: Fix issue when sorting a list with exactly 1 element
Directory: Fix pattern matching issue