R CMD CHECK fixes. partly solves #9 (which will be an ongoing thing)