ice: fix potential infinite loop because loop counter being too small