Fixed the Window class having a ridiculous CPU usage.