Code improvements,typo fixes.