Fix typo and remove unused code