Fixing a bad list access