Introduced template bug in allocEmptyBuffer function