Documentation and style fixes merged from @purcell on github.