Improved handling of tree events