Fix variable reference in list comprehension