Added additional checks for shaders.