fixes for #25, #26 and #27

how about a new version to CRAN? especially for the sake of #23