Fix some typos and logic