corrected bug in random effects averaging