Fixed a very annoying memory corruption that was driving me nuts. Basically, had to move the list detach to the end of the outer window's unlinking, since more inner windows could have been added to the list during the unlink (and detach especially). In hindsight, it's obvious, but it frustrated me to no end to track it down since it was very "random".