some fixes to pass R CMD check