fix for issue #7588, overflow now handled correctly