Fix some linear iteration bugs.