Incorrect sort order and dict creation fixed in stacker.py