add flatten problem and test
(cherry picked from commit 164bc8e)
remove duplicate 'should' in test description. Add consintent formatting of tests
(cherry picked from commit e9773ad)