Fixes syntax errors and error class