Merge pull request #202 from joerivandervelde/master

Bugfixes for R API