Fix list comprehension bug

Improper list comprehension causes assertion error.