fixed up some things to pass CRAN checks (mostly)