For complete robustness, you also need to handle `global_cell == 0`.  That's interpreted as "all cells active" (in which case `assert (PVTNUM.size() == numCompressed)`.