diff --git a/CMakeLists.txt b/CMakeLists.txt
index ad01c211a99dec30314a6b6b4d4befce9b5fc46e..bee932219b734da512fbf1db4e5b16a30194609c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -122,7 +122,7 @@ elseif(CMAKE_COMPILER_IS_GNUCXX)
   set(CMAKE_CXX_FLAGS
     "${CMAKE_CXX_FLAGS} -fsigned-char")
 
-elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
+elseif(${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
   set(CMAKE_CXX_FLAGS
       "${CMAKE_CXX_FLAGS} -std=c++0x -stdlib=libc++ -Wall -pedantic -Werror \
                           -Wextra")
diff --git a/src/idl_gen_text.cpp b/src/idl_gen_text.cpp
index 4ff13c8a961138e87ff0547c2808183c9eddbf88..17cd987dd7686203bc67dad24396f153b8e6a7ce 100644
--- a/src/idl_gen_text.cpp
+++ b/src/idl_gen_text.cpp
@@ -148,12 +148,12 @@ static bool EscapeString(const String &s, std::string *_text, const IDLOptions&
             } else if (ucc <= 0x10FFFF) {
               // Encode Unicode SMP values to a surrogate pair using two \u escapes.
               uint32_t base = ucc - 0x10000;
-              uint16_t highSurrogate = (base >> 10) + 0xD800;
-              uint16_t lowSurrogate = (base & 0x03FF) + 0xDC00;
+              auto high_surrogate = (base >> 10) + 0xD800;
+              auto low_surrogate = (base & 0x03FF) + 0xDC00;
               text += "\\u";
-              text += IntToStringHex(highSurrogate, 4);
+              text += IntToStringHex(high_surrogate, 4);
               text += "\\u";
-              text += IntToStringHex(lowSurrogate, 4);
+              text += IntToStringHex(low_surrogate, 4);
             }
             // Skip past characters recognized.
             i = static_cast<uoffset_t>(utf8 - s.c_str() - 1);