Added a slight fix for the R export script, addresses #151.