diff --git a/tangostationcontrol/devices/base_device_classes/antennafield_device.py b/tangostationcontrol/devices/base_device_classes/antennafield_device.py
index 2a44b6e2fc563eb9731b4e76f871d8643e63428e..2eff491b193bbc9df1587d61daa28d1298dd5286 100644
--- a/tangostationcontrol/devices/base_device_classes/antennafield_device.py
+++ b/tangostationcontrol/devices/base_device_classes/antennafield_device.py
@@ -981,7 +981,9 @@ class AF(LOFARDevice):
 
         try:
             # make sure we update RCU_PWR_ANT_on_RW neatly with our mask
-            RCU_PWR_ANT_on_RW = self.read_attribute("RCU_PWR_ANT_on_RW") and ~mask
+            RCU_PWR_ANT_on_RW = numpy.logical_and(
+                self.read_attribute("RCU_PWR_ANT_on_RW"), numpy.logical_not(mask)
+            )
 
             # Turn off power to all antennas (in the requested mask)
             self.proxy.write_attribute("RCU_PWR_ANT_on_RW", RCU_PWR_ANT_on_RW)
@@ -1006,7 +1008,9 @@ class AF(LOFARDevice):
 
         # Power off what should be off, f.e. if they got turned off in the mask
         # but are still powered.
-        self.power_antennas_off(~self.read_attribute("Antenna_Usage_Mask_R"))
+        self.power_antennas_off(
+            numpy.logical_not(self.read_attribute("Antenna_Usage_Mask_R"))
+        )
 
         # Disable controlling the tiles that fall outside the mask
         self.proxy.write_attribute(