Roxygenation.
Adding error messages and associated tests.