Fixed illegal list access using first() on empty list.