bugfixes prepering for R CMD CHECK