Fix integer overflow issue noted by Magnus Hagander, as well as a bunch of other infelicities in commit ee1e5662 and its unreasonably large number of followups.
Attach a file by drag & drop or click to upload