Add error handling to Index and Vertex Buffers