Fix Texture3D load failing always without an error message. Closes #513.