Fixed buffer counting

Change-Id: I344728c8b25ae78dd715d029bfa0439fdce47c77