Fix in M-val calculation