On infrared and ultraviolet divergences of cosmological perturbations