Fixed buffer counting

Change-Id: I5e0020e2d822d4e9df07c488c24a942a7bf0542b