fix list.flatten bug (close #90)