Underscored Keys logic fix

The underscored Keys logic code did not work (some undefined variable).
Here is the little adaptation that make it work for me