Fix nested generator