Fix typo in python3 control flow
Fix support for range dicts

Fixes the test_aperture