Bug fix: cal residual plots