Added database checks to avoid overflows.