Although I can't say exactly what is causing your problem (regardless of which shipping module(s) you are using, I CAN say that you are treading very murky waters.
I wrote the Austpost Improved shipping module, and not even I had to concern myself with the $GLOBALS arrays to make things work.
I'd suggest that if you are having to delve into this part of the code you may be better off doing a fresh install and starting again.
Cheers
Rod




