Sort out boolean operators and range/irange difference