Made set_one() and set_zero() behavior consistent across shared matrices and vectors