Remove unused var
Add validation
Fix typo