Pass SyntaxErrors to error handler too. [Fixes #774]