fixed cursor leak for very small batch sizes
fixed typo
added generated file