* Issue#1212: Corrected order of operations in extract_pairs to ensure that it does not return an empty list as one of the pairs.
* Issue#1212: Updated the tests to exercise failure case that raised this isssue.
* Issue#1212: Updated extract_indexes_from_pairs to strip any empty pairs from the input list.