fixed a bug for some models with nrow(tuneGrid) == 1

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/caret@838 edb9625f-4e0d-4859-8d74-9fd3b1da38cb
added some error trapping and fixes to internal functions

git-svn-id: svn://svn.r-forge.r-project.org/svnroot/caret@839 edb9625f-4e0d-4859-8d74-9fd3b1da38cb