bugfix in init_fields (do not init avg fields that are not used)