[PLAT-3629] Fixing off-by-one bug