Fix an integer overflow in isolate

See cms-dev/cms#324