Fix (3*a)^2=3*a^2 bug