drop intermediate collections after final result is generated (Fixes #339)