fix broken office auto-generation; add/improve a few comments