Updated tests and doctests to reflect the changes to the external API.