Improve handling of session variable openedArray
Improve handling of tree sorting session variables