Python: Fixed get_address_ranges