runtime: fix list access for last element