Merge in caret fix from @myint