Fix infinite loop in mobile_grid