Reduce memory usage of trees slightly
Correct rules for checking references which can be overloaded