Fixed a bug that meant the modules weren't being processed. This was due to the n_fillhist variable not being set and the fillhists array not being filled correctly