Fix of Fix of t1236: higher-kinded

Fix of d6df293d2120f2247198cb6646a23c338f7dcbbf. It turned out the original commit
was faulty in that iterator.flatten did not typecheck. The problem is fixed in this
commit and flatten is added to the collections test.