fix warnings
export new toRTree function, and rename toTree -> toDTree