Moved statements ensuring variable ranges to be after the interpolation steps