Closing a directory was always clearing the selection.