diff --git a/data_tamer_cpp/include/data_tamer/channel.hpp b/data_tamer_cpp/include/data_tamer/channel.hpp
index 63ad3f1..3a76094 100644
--- a/data_tamer_cpp/include/data_tamer/channel.hpp
+++ b/data_tamer_cpp/include/data_tamer/channel.hpp
@@ -54,7 +54,7 @@ class LoggedValue
    * @param value   new value
    * @param auto_enable  if true and the current instance is disabled, call setEnabled(true)
    */
-  void set(const T& value, bool auto_enable = false);
+  void set(const T& value, bool auto_enable = true);
 
   /// @brief get the stored value.
   [[nodiscard]] T get();
@@ -416,7 +416,7 @@ inline void LoggedValue<T>::set(const T& val, bool auto_enable)
   if (auto channel = channel_.lock())
   {
     value_ = val;
-    if (auto_enable)
+    if (!enabled_ && auto_enable)
     {
       channel->setEnabled(id_, true);
       enabled_ = true;
@@ -425,10 +425,7 @@ inline void LoggedValue<T>::set(const T& val, bool auto_enable)
   else
   {
     value_ = val;
-    if (!enabled_ && auto_enable)
-    {
-      enabled_ = true;
-    }
+    enabled_ |= auto_enable;
   }
 }
 
diff --git a/data_tamer_cpp/include/data_tamer_parser/data_tamer_parser.hpp b/data_tamer_cpp/include/data_tamer_parser/data_tamer_parser.hpp
index 94b0737..2c680cf 100644
--- a/data_tamer_cpp/include/data_tamer_parser/data_tamer_parser.hpp
+++ b/data_tamer_cpp/include/data_tamer_parser/data_tamer_parser.hpp
@@ -219,11 +219,11 @@ bool TypeField::operator==(const TypeField& other) const
 inline Schema BuilSchemaFromText(const std::string& txt)
 {
   auto trimString = [](std::string& str) {
-    while (str.back() == ' ' || str.back() == '\r')
+    while (!str.empty() && (str.back() == ' ' || str.back() == '\r'))
     {
       str.pop_back();
     }
-    while (str.front() == ' ' || str.front() == '\r')
+    while (!str.empty() && (str.front() == ' ' || str.front() == '\r'))
     {
       str.erase(0, 1);
     }