Some minor optimzations and fixes in logical_operations.mbl