Fixed problems with constructing syntax errors. There could still be others.