Clean up residualization and add centering and scaling.