treemachine wrapper and tests fixed