Fixed segfault from invalid initalization of a string.
Properly determine the maximum number of layers in an ARRAY_TEXTURE buffer.