Fix potential overflow