fix many syntax errors