Add assert()s to tree.h to soothe Clang static analyzer.