bug in grammar generation