NXP-14861: Fix grid counting