update WMCore/Lexicon.py and fix for #1007