Fix typos and coding style
Remove unused variable