             ppos.x = com.x + ri.x;
             ppos.y = com.y + ri.y;
             ppos.z = com.z + ri.z;
-            ppos.w = com.w;
+            ppos.w = pos.w;
             
             // time to fix the periodic boundary conditions (FLOPS: 15)
             float x_shift = rintf(ppos.x * box.Lxinv);

        if (idx_body < n_bodies && idx_particle_index != INVALID_INDEX)
            {
            particle_pos = tex1Dfetch(rigid_data_particle_pos_tex, idx_particle);
            int4 image = tex1Dfetch(pdata_image_tex, idx_particle_index);
            
            // compute ri with new orientation

            ppos.x = com.x + ri.x;
            ppos.y = com.y + ri.y;
            ppos.z = com.z + ri.z;
            ppos.w = pos.w;
            
            // time to fix the periodic boundary conditions (FLOPS: 15)
            float x_shift = rintf(ppos.x * box.Lxinv);
