Fix some typos, reformat some comments, add a missing header.