Finished the documentation, and fixed two bugs noticed while doing so.