Improve docs and test