Fix sign == 0
gradient w.r.t. w