Fix a buffer generator bug