`$mod` function does not trap the ZeroDivisionError.
See code changes in pull request #1504 submitted by rdswift.
See code changes in pull request #1504 submitted by rdswift.