Fix generator bug