Fix various typos and syntax inconsistencies