Fixes NullPointerException when initializing tree