Bug fixes and tiny changes from working on docs