Fix and improve syntax checking (`check` option)