fix various syntax errors