Use Integer(q) instead of *integer(q) and fix a typo, explicit check for Rational