Fix bug in GL buffer allcation.