Propagate various residuals to match the sample
Merge pull request #4 from pdmetcalfe/bugfix/sample

thanks