Fixed max buffer counting

Change-Id: I4ee1ee616bd946a2086930d07c1f5faa697c9e0f