Fixed bug affecting differentiation involving multiplications