Ensure 'm' is correctly captured as number of resid values