added more checking to fitted and residual functions and updated help info