Fix some typos and add functions