Move window deletions to their proper places

Fixes compile error.