Fix typo and code error