Fix factor rule

Now the compiler doesn't complain about factor rule.
Fix an error in expression type definition