Patchs by Matt McCutche to fix Treeboss related Bugs 469 and 504.