fix tree items possibly getting the wrong foreground or background