Minor bug and typo fixes