Removed unused code, fixed some typos.