Handle cons-cells properly in -flatten

Fixes #21