Fix bug and fix typo