Merge pull request #669 from nla/nn-reorder-children

reorder children, merged.
Used amberdb 1.1.171 to fix the orphan children problem