Fixed bug with null lists in for loops.