Fix some typos and bugs.