Merge "Fix bug in maximum number of allocs." am: 8b04903ba1

Change-Id: I2e7f2d9b8d3846b9a0c0cdd0948a1d3d20d14817