Fixed some faulty assumptions regarding window events