Fix typo and typeof issues.