Merge "Fix loop iteration bug." am: 1a74681173
am: db80339f95

Change-Id: I7f95ec816b3e0e54e9c662da550f931e160ab54b