Initial Rmd setup. Minor fixes in script.