Minor edits and bug fixes