Add some documentation, and fix a few errors