Fix sort for tree filter