Update demag.go

Just update to latest from 'kelvin' branch.