Fix modulo bias, comment on unsafe code.

Note that I haven't tested these changes (I did it in a github window) - but I'm sure you get the gist of them :)