diff --git a/src/runner_doiact.h b/src/runner_doiact.h
index 1fd0492803ba2053a25fbb73768e1c357b11658d..54532b741ae763d9adbb3a542784dcc767445ec3 100644
--- a/src/runner_doiact.h
+++ b/src/runner_doiact.h
@@ -2293,13 +2293,13 @@ void DOSUB_SUBSET ( struct runner *r , struct cell *ci , struct part *parts , in
         /* Get the cell dimensions. */
         h = fmin( ci->h[0] , fmin( ci->h[1] , ci->h[2] ) );
 
+        /* Get the type of pair if not specified explicitly. */
+        sid = space_getsid( s , &ci , &cj , shift );
+
         /* Recurse? */
         if ( ci->split && cj->split &&
              fmaxf( ci->h_max , cj->h_max )*kernel_gamma + ci->dx_max + cj->dx_max < h/2 ) {
              
-            /* Get the type of pair if not specified explicitly. */
-            sid = space_getsid( s , &ci , &cj , shift );
-
             /* Different types of flags. */
             switch ( sid ) {