Some minor changes to integer overflow handling