Fixed produce function.