Corrected the implementation of extractSubBFS

There was some funny mistakes in it. I will write more tests
Merge branch 'master' of https://github.com/aghosn/persistence