Avoiding duplicate work when maxRows changes.

Change-Id: Iea05767c435a31e8604a206585e43ee51772969c