diff --git a/swcio.hpp b/swcio.hpp
index b32d5e9effb315e1dd60c3f9ddcd9c694017ec84..d362109dd15b771ac897bb884380682214f113b0 100644
--- a/swcio.hpp
+++ b/swcio.hpp
@@ -194,8 +194,7 @@ private:
     T parse_value_strict(std::istream &is)
     {
         T val;
-        is >> val;
-        check_parse_status(is);
+        check_parse_status(is >> val);
 
         // everything's fine
         return val;
@@ -215,8 +214,7 @@ template<>
 cell_record::kind swc_parser::parse_value_strict(std::istream &is)
 {
     int val;
-    is >> val;
-    check_parse_status(is);
+    check_parse_status(is >> val);
 
     // Let cell_record's constructor check for the type validity
     return static_cast<cell_record::kind>(val);