merge partial diff from #410