bug fix to printing grammar