Update flatten tests for new Test objects.
Fix reduce tests for the need to know types when creating temporaries.