added ability to add custom fields to tree nodes; added more assertions