Thanks,
You were absolutely right, the symptoms were that the stack was clobering global variables. I finally found the CPU build options for stack size and saw that it was originally set to 80! I increased it and works fine now. Thanks.
Let this be a warning to those who unit test code and find problems durring integration, stack size and subroutine nesting can bite you if you don't know what to look for.
Daniel you are awesome!