Some changes, and a few debuging catches