Re-attached custom tree generation. Closes #382.