Optimized cell rendering loop.
Fixing NPEs.