Using somewhat more consistent version of `flatten`.