Fixed apparent bug in tests, preparing for branch cherrypick.