diff --git a/StandAlone/StandAlone.cpp b/StandAlone/StandAlone.cpp
index e0faecfcd90dbd8c392582f173bcbf10f7999ea1..da6f10a35286de294769aeaf2d0d1709b83c5e5b 100644
--- a/StandAlone/StandAlone.cpp
+++ b/StandAlone/StandAlone.cpp
@@ -867,7 +867,6 @@ char** ReadFileData(const char* fileName)
     const int maxSourceStrings = 5;
     char** return_data = (char**)malloc(sizeof(char *) * (maxSourceStrings+1));
 
-    //return_data[MAX_SOURCE_STRINGS]=NULL;
 	if (errorCode) {
         printf("Error: unable to open input file: %s\n", fileName);
         return 0;
@@ -878,10 +877,9 @@ char** ReadFileData(const char* fileName)
 
 	fseek(in, 0, SEEK_SET);
 	
-	
 	if (!(fdata = (char*)malloc(count+2))) {
-            printf("Error allocating memory\n");
-            return 0;
+        printf("Error allocating memory\n");
+        return 0;
     }
 	if (fread(fdata,1,count, in)!=count) {
             printf("Error reading input file: %s\n", fileName);
diff --git a/Test/baseResults/depthOut.frag.out b/Test/baseResults/depthOut.frag.out
index 733be17cf0f77be3226a11d0bfcbdcc52d7c5b99..5e858452cda75c47ef2a199766b997102ccd4559 100644
--- a/Test/baseResults/depthOut.frag.out
+++ b/Test/baseResults/depthOut.frag.out
@@ -4,26 +4,21 @@ WARNING: 0:3: varying deprecated in version 130; may be removed in future releas
 WARNING: 0:4: varying deprecated in version 130; may be removed in future release
 
 0:? Sequence
-0:8  Function Definition: main( (void)
-0:8    Function Parameters: 
-0:10    Sequence
-0:10      move second child to first child (float)
-0:10        'gl_FragDepth' (gl_FragDepth float)
-0:10        'Depth' (smooth in float)
-0:11      move second child to first child (4-component vector of float)
-0:11        'gl_FragColor' (fragColor 4-component vector of float)
-0:11        'Color' (smooth in 4-component vector of float)
-0:12      move second child to first child (4-component vector of float)
-0:12        'foo' (out 4-component vector of float)
-0:12        'Color' (smooth in 4-component vector of float)
+0:6  Function Definition: main( (void)
+0:6    Function Parameters: 
+0:8    Sequence
+0:8      move second child to first child (float)
+0:8        'gl_FragDepth' (gl_FragDepth float)
+0:8        'Depth' (smooth in float)
+0:9      move second child to first child (4-component vector of float)
+0:9        'gl_FragColor' (fragColor 4-component vector of float)
+0:9        'Color' (smooth in 4-component vector of float)
 0:?   Linker Objects
 0:?     'Color' (smooth in 4-component vector of float)
 0:?     'Depth' (smooth in float)
-0:?     'foo' (out 4-component vector of float)
 
 
 Linked fragment stage:
 
-ERROR: Linking fragment stage: Cannot use gl_FragColor or gl_FragData when using user-defined outputs
 
 
diff --git a/glslang/MachineIndependent/localintermediate.h b/glslang/MachineIndependent/localintermediate.h
index 7c91686b977bccf122600b602f4c9e5f03183c1b..aad8135c30beae011cf3bb85c3ac6aa95bb65b65 100644
--- a/glslang/MachineIndependent/localintermediate.h
+++ b/glslang/MachineIndependent/localintermediate.h
@@ -126,6 +126,7 @@ public:
     int getVersion() const { return version; }
     void setProfile(EProfile p) { profile = p; }
     EProfile getProfile() const { return profile; }
+    EShLanguage getStage() const { return language; }
     void setTreeRoot(TIntermNode* r) { treeRoot = r; }
     TIntermNode* getTreeRoot() const { return treeRoot; }
     void addMainCount() { ++numMains; }
diff --git a/glslang/Public/ShaderLang.h b/glslang/Public/ShaderLang.h
index 5abdbd5cafcdcf1d475db6c455d1e3d22192b6c2..b5cd58e80a33ace58ef9852a70928fa744c7c782 100644
--- a/glslang/Public/ShaderLang.h
+++ b/glslang/Public/ShaderLang.h
@@ -223,21 +223,6 @@ SH_IMPORT_EXPORT int ShExcludeAttributes(const ShHandle, int *attributes, int co
 //
 SH_IMPORT_EXPORT int ShGetUniformLocation(const ShHandle uniformMap, const char* name);
 
-// These are currently unused in the front end, but consumers of the front-end still 
-// be rely on them:
-enum TDebugOptions {
-    EDebugOpNone               = 0x000,
-    EDebugOpIntermediate       = 0x001,
-    EDebugOpAssembly           = 0x002,
-    EDebugOpObjectCode         = 0x004,
-    EDebugOpLinkMaps           = 0x008,
-    EDebugOpSuppressInfolog    = 0x010,
-    EDebugOpMemoryLeakMode     = 0x020,
-    EDebugOpTexturePrototypes  = 0x040,
-    EDebugOpRelaxedErrors      = 0x080,
-    EDebugOpGiveWarnings       = 0x100,
-};
-
 #ifdef __cplusplus
     }  // end extern "C"
 #endif
@@ -282,7 +267,7 @@ void FinalizeProcess();
 // provide the shader through setStrings(), then call parse(), then query
 // the info logs.
 //
-// N.B.: Does not yet support having the same TShader instance being linked multiple programs.
+// N.B.: Does not yet support having the same TShader instance being linked into multiple programs.
 //
 // N.B.: Destruct a linked program *before* destructing the shaders linked into it.
 //
@@ -292,9 +277,12 @@ public:
     virtual ~TShader();
     void setStrings(const char* const* s, int n) { strings = s; numStrings = n; }
     bool parse(const TBuiltInResource*, int defaultVersion, bool forwardCompatible, EShMessages);
+
     const char* getInfoLog();
     const char* getInfoDebugLog();
 
+    EShLanguage getStage() const { return stage; }
+
 protected:
     TPoolAllocator* pool;
     EShLanguage stage;
@@ -329,6 +317,8 @@ public:
     const char* getInfoLog();
     const char* getInfoDebugLog();
 
+    TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; }
+
     // Reflection Interface
     bool buildReflection();                          // call first, to do liveness analysis, index mapping, etc.; returns false on failure
     int getNumLiveUniformVariables();                // can be used for glGetProgramiv(GL_ACTIVE_UNIFORMS)