updated kfsst.r from ross
R code changes: error/param handling