Index: trunk/ippTools/src/stacktool.c
===================================================================
--- trunk/ippTools/src/stacktool.c	(revision 38062)
+++ trunk/ippTools/src/stacktool.c	(revision 39926)
@@ -1328,4 +1328,8 @@
     psFree(where);
 
+    // This needs to be sorted by skycell_id, or the ppSkycell calls to mosaic things
+    // don't work properly.
+    psStringAppend(&query, " ORDER BY stackRun.skycell_id ");
+    
     // treat limit == 0 as "no limit"
     if (limit) {
