Replace flat_map with map .. flatten to restore 1.8.7 compatibility
Merge pull request #367 from ndbroadbent/remove_flat_map

Replace flat_map with map .. flatten to restore 1.8.7 compatibility