Fix invalid code generated for synpred fragments
Remove some ST warnings when compiling the grammar

These chages were inspired by the Java target