A little error checking, a little reorganization
Tribes sample (from game)