Rename function to ensureBuffer