Fixes #16519. Unintended global variables, unused variable, and wrong implementation of disableValues() - Thanks Paul Christopher  (CLA) and Adrian Vasiliu (IBM, CCLA).