fix magnetization average (Thanks Jonathan)