Fixing some, but not all compile errors in stats generator