CursorTreeAdapter backport + NPE fix
v-0.8 build