Fix to properly check for 'undefined'
Fix to properly check for 'undefined' and default value initializations