Fixed a few errors in R2

All of R2 seems to compile as of now. It's having some errors when
attempting to link R1 into the project, but other than that everything
looks good. We only have a few warnings in R2 about suspicious pointer
conversions