Merge "Fix exception when a focused item is detached."