Fixed crashes on empty tree...