Fix flatten bug. Thanks @hughsk

https://github.com/hughsk/flat/issues/6#issuecomment-35221357