Fix up my R functions. They're not lovely.