fixes to be accepted as CRAN package