Also fixes how pinning works in some edge cases.
Also force all its parents to be open, similar to forceOpen from the previous commit (which, incidentally, this commit removes again).