Added some docs, fixed a test or two