Fix a couple tiny bugs and document things.