pet_fix: Fix occasional nil index error