Add some docs and fix a test