Fixed bugs in multiplication and division of monomials