Re #361, verify the key is in the dict before accessing
PEP8 fixes
py2.5 fixes
Doc updates