preserve branch ordering when creating a buffer
Merge pull request #525 from ndawe/master

[MRG] preserve branch ordering when creating a buffer