Add tests and update documentation for 5d9165d