Repair createTree API a bit.