Modification of types of variables to prevent overflow