fix ElementBuffer constructor when using pointers