Fixed nullpointer bug. Improved iteration printout.