diff --git a/multiscreen-compositor/qml/main.qml b/multiscreen-compositor/qml/main.qml
index b8255568a1e01afa20d7b8b32fa0a878de476f2b..16629dcec3dff579c93cf200ac588a994e9fa710 100644
--- a/multiscreen-compositor/qml/main.qml
+++ b/multiscreen-compositor/qml/main.qml
@@ -191,6 +191,8 @@ WaylandCompositor {
     // Remove destroyed surface from the suface list
     // =============================================
     onSurfaceAboutToBeDestroyed: {
+        // Removing this seems to have fixed the crashes.
+        //Also, with the new way to keep the applist clean of undefined objects, it is unnecessary.
         /*
         console.log("Surface will be destroyed", surface);
         console.log("appList length: ", activeSurfaces.length);
@@ -305,13 +307,20 @@ WaylandCompositor {
             windowVisibility(windowid, true)
         }
         function onLogWindows(){
+            cleanUpApplist();
             console.log("Active surfaces:")
             for (var i=0; i < activeSurfaces.length; i++) {
                 var item = activeSurfaces[i];
-                console.log("- Surface", i, ": ", item.surface, "on", item.screen)
+                if (item.surface.surface) {
+                    console.log("- Surface", i, item.surface, "pid", item.surface.surface.client.processId, "on screen", item.screen);
+                }
+                else if (item.surface.shellSurface) {
+                    console.log("- Surface", i, "iviId:", item.surface.shellSurface.iviId, item.surface, "on screen", item.screen);
+                }
             }
         }
         function onGetScreen(windowid){
+            cleanUpApplist();
             console.log("Received a getScreen Signal for window ID: ", windowid)
             var screenId = -1;
             for (var i=0; i < activeSurfaces.length; i++) {
@@ -322,7 +331,7 @@ WaylandCompositor {
                         screenId = item.screen;
                     }
                     else if ((item.surface.shellSurface) && ( windowid === item.surface.shellSurface.iviId)) {
-                        console.log("Surface", i, item.surface, "on screen", item.screen)
+                        console.log("- Surface", i, "iviId:", item.surface.shellSurface.iviId, item.surface, "on screen", item.screen)
                         screenId = item.screen;
                     }
                 }