Merge "Fix problem adding too many frames." am: 9074871af2
am: 19009e036a

Change-Id: If07ac4380dfd10a4ab6d4a9fb76932b765b66ac7