debugging the expand/merge problems