Fix a NameError in span_to_lines() and a test_indexers test failure.