Correct a bug where openWindow could get dereferenced.
Be even a little more careful.