Thanks for reporting that. I applied the attached patches. The first fixes the bug and adds a test case, the second fixes some unlikely and hard-to-test-for integer-overflow bugs I noticed while I was in the neighborhood.