doc edits and bug fixes