Fixed app freezing if the first application window could not be created