Issue #867: improve pedigree layout & fix layout bugs