Fix coding style
Fix typos; improve comments