bug fixes and documentation edits