fix bug in pmag.domean()