This is the same fix that @thoennes made in walberla/walberla!573 (merged) and also the same as pystencils!310 (merged).