doc, and corrected R tests