Fixes possible overflow in natural mergesort