Add checks for lenght calculations.