Fix for correct generation patches