More loop simplification.

(Iterating a nil collection does nothing; collections can't contain nil
values.
Move instance variables into implementation.