Fix roxygen and other errors picked up by R CMD check