Applied Fabian Affolter's patch to make generator entry more generic