fix __or__ and __ror__ functions