Improve docstring and add test case