Check for `Integer` before creating a `Rational`
Add missing `assert` statement
Merge pull request #178 from thilinarmtb/fix_div_bug_#177

Merging because tests pass.