Fix typo and remove unused variables