diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c
index 45979a57..d6e2744a 100644
--- a/src/json.hpp.re2c
+++ b/src/json.hpp.re2c
@@ -1983,15 +1983,14 @@ class basic_json
         o.width(0);
 
         // do the actual serialization
-        j.dump(o, prettyPrint, indentation);
+        j.dump(o, prettyPrint, static_cast<int>(indentation));
         return o;
     }
 
     /// serialize to stream
     friend std::ostream& operator>>(const basic_json& j, std::ostream& o)
     {
-        o << j;
-        return o;
+        return o << j;
     }