Added pBuffer size correction