Improved exists check
Allow underscore in key names