Added plotres to plot residuals
Fix up NaNs in residuals file when level too low