fixing issues to enable running via spark.rstudio