Code was evaluating !expression[key] while attempting to see if the key was present, but this was evaluating to true for false values as well as missing keys. Closes #2797.