diff --git a/src/OpenFOAM/primitives/bools/bool/boolIO.C b/src/OpenFOAM/primitives/bools/bool/boolIO.C
index f098a3e1864e74bbebc61ca0247a29cc73cd6a44..8f19c58bf36d84da1981a4f8dd40dddd0796cdfe 100644
--- a/src/OpenFOAM/primitives/bools/bool/boolIO.C
+++ b/src/OpenFOAM/primitives/bools/bool/boolIO.C
@@ -45,7 +45,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const bool b)
 {
     // we could also write as text string without any difficulty
     // os  << (b ? "true" : "false");
-    os.write(int(b));
+    os.write(label(b));
     os.check(FUNCTION_NAME);
     return os;
 }
diff --git a/src/OpenFOAM/primitives/direction/directionIO.C b/src/OpenFOAM/primitives/direction/directionIO.C
index e73351593329d81092cb9abe93248bff8d81064a..135eaf89b15fbecd6eaaf140ed0da5b0684f9f1c 100644
--- a/src/OpenFOAM/primitives/direction/directionIO.C
+++ b/src/OpenFOAM/primitives/direction/directionIO.C
@@ -68,7 +68,7 @@ Foam::Istream& Foam::operator>>(Istream& is, direction& d)
 
 Foam::Ostream& Foam::operator<<(Ostream& os, const direction d)
 {
-    os.write(int(d));
+    os.write(label(d));
     os.check(FUNCTION_NAME);
     return os;
 }