Fix A+B optimization