convert dict comprehensions to python2.6 compatible
fix pep8 warnings