Fix various syntax errors and typos