Minor modifications and typo fixes
Merged with Shen's copy