Do not redefine variables in list comprehensions
Remove dead code