Fixed crashes relating to recent window changes.