Fix softmax for r2 (as other PR) and partial fix for R1.