added R CMD check tests
fixed some test errors