Fix makestats to produce valid HTML