diff --git a/Application/CMakeLists.txt b/Application/CMakeLists.txt
index a1bc6d1ccd2d2fb4ca29b13f4a56fbaac966d4b6..2e411a7243198d077e5dbc33ca11a88d53394086 100644
--- a/Application/CMakeLists.txt
+++ b/Application/CMakeLists.txt
@@ -802,7 +802,7 @@ if(${TREX_BUILD_OPENCV})
             -DBUILD_DOCS:BOOL=FALSE
             -DBUILD_EXAMPLES:BOOL=FALSE
             -DBUILD_TESTS:BOOL=FALSE
-            -DCMAKE_BUILD_TYPE=Release
+            -DCMAKE_BUILD_TYPE=$<$<CONFIG:Debug>:Release>$<$<CONFIG:Release>:Debug>
             -DBUILD_SHARED_LIBS:BOOL=FALSE
             -DBUILD_NEW_PYTHON_SUPPORT:BOOL=OFF
             -DBUILD_WITH_DEBUG_INFO=OFF
diff --git a/Application/src/commons/common/cpputils/debug/Debug.cpp b/Application/src/commons/common/cpputils/debug/Debug.cpp
index 5db6822555dd39bbe2dbab86552791de95c8d8f5..6c7c22fef1334ace66aa8e7fe17d07a1c432e27a 100644
--- a/Application/src/commons/common/cpputils/debug/Debug.cpp
+++ b/Application/src/commons/common/cpputils/debug/Debug.cpp
@@ -516,7 +516,7 @@ insert_start(tree, &current_node, e); }
                     case '<':
                     case '>':
                     case ':':
-                        if (current == '<' || (current == ':' && i < msg->buf.length() && msg->buf[i + 1] != ':' && (size_t)word_start != i)) {
+                        if (current == '<' || (current == ':' && i+1 < msg->buf.length() && msg->buf[i + 1] != ':' && (size_t)word_start != i)) {
                             TreeNode<DEBUG::PARSE_OBJECTS> *node;
                             long str_start = -1;
                             long off = 0;
@@ -564,7 +564,7 @@ insert_start(tree, &current_node, e); }
                         
                         if (current == ':') {
                             // match ':' pairs
-                            if ((i < msg->buf.length() && msg->buf[i + 1] == ':')
+                            if ((i+1 < msg->buf.length() && msg->buf[i + 1] == ':')
                                 || (i > 0 && msg->buf[i - 1] == ':'))
                             {
                                 INSERT_SINGLE(PARSE_OBJECTS::CLASSSEPERATOR, i);
diff --git a/Application/src/commons/common/gui/GLImpl.cpp b/Application/src/commons/common/gui/GLImpl.cpp
index 5770433c0bfef410e143f5e21cb9452333f25e8d..d8f616bc92c8b253a64f823ba9f68b2ee191fa4f 100644
--- a/Application/src/commons/common/gui/GLImpl.cpp
+++ b/Application/src/commons/common/gui/GLImpl.cpp
@@ -332,6 +332,8 @@ void GLImpl::check_thread_id(int line, const char* file) const {
 #endif
 }
 
+static std::vector<uchar> empty;
+
 TexturePtr GLImpl::texture(const Image * ptr) {
     GLIMPL_CHECK_THREAD_ID();
     
@@ -372,7 +374,12 @@ TexturePtr GLImpl::texture(const Image * ptr) {
 #endif
     
     auto width = next_pow2(ptr->cols), height = next_pow2(ptr->rows);
-    glTexImage2D(GL_TEXTURE_2D, 0, output_type, width, height, 0, input_type, GL_UNSIGNED_BYTE, NULL);
+    auto capacity = size_t(ptr->dims) * size_t(width) * size_t(height);
+    if (empty.size() < capacity)
+        empty.resize(capacity, 0);
+
+    glTexImage2D(GL_TEXTURE_2D, 0, output_type, width, height, 0, input_type, GL_UNSIGNED_BYTE, empty.data());
+
     glTexSubImage2D(GL_TEXTURE_2D,0,0,0, ptr->cols, ptr->rows, input_type, GL_UNSIGNED_BYTE, ptr->data());
     glBindTexture(GL_TEXTURE_2D, 0);
     
@@ -451,7 +458,16 @@ void GLImpl::update_texture(PlatformTexture& id_, const Image *ptr) {
         input_type = GL_RG;
     }
 #endif
-    
+
+    auto capacity = size_t(ptr->dims) * size_t(id_.width) * size_t(id_.height);
+    if (empty.size() < capacity)
+        empty.resize(capacity, 0);
+
+    if (ptr->cols != id_.width || ptr->rows != id_.height) {
+        glTexSubImage2D(GL_TEXTURE_2D, 0, ptr->cols, 0, id_.width - ptr->cols, id_.height, input_type, GL_UNSIGNED_BYTE, empty.data());
+        glTexSubImage2D(GL_TEXTURE_2D, 0, 0, ptr->rows, ptr->cols, id_.height - ptr->rows, input_type, GL_UNSIGNED_BYTE, empty.data());
+        //glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, id_.width, id_.height, input_type, GL_UNSIGNED_BYTE, empty.data());
+    }
     glTexSubImage2D(GL_TEXTURE_2D,0,0,0, ptr->cols, ptr->rows, input_type, GL_UNSIGNED_BYTE, ptr->data());
     //glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ptr->cols, ptr->rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptr->data());
     glBindTexture(GL_TEXTURE_2D, 0);
diff --git a/Application/src/tracker/tracking/DatasetQuality.cpp b/Application/src/tracker/tracking/DatasetQuality.cpp
index 6d7de494ffd349a5f26ee587f1f96e8499a7e5b0..310d48fad4f8409a68b65f10a33ef08867b0b1d9 100644
--- a/Application/src/tracker/tracking/DatasetQuality.cpp
+++ b/Application/src/tracker/tracking/DatasetQuality.cpp
@@ -275,7 +275,8 @@ DatasetQuality::Single DatasetQuality::evaluate_single(idx_t id, Individual* fis
     long_t number_frames = 0;
     bool debug = false;
     
-    if(FAST_SETTINGS(manually_approved).find(_consec.start) != FAST_SETTINGS(manually_approved).end())
+    auto manually_approved = FAST_SETTINGS(manually_approved);
+    if(manually_approved.find(_consec.start) != manually_approved.end())
         debug = true;
     
     FrameRange consec(Rangel(-1, -1));