Fixed #211. Integer overflows should be fixed now.