Fix bug and typo