Replaced dictionary comprehensions to make code Python 2.6 compatible.