Fixed issues

Fixed some build issues stemming from merged code. Also committing
R-related files, though I'm not sure it's necessary.