Fix to properly assign a default value
Fix to properly check for 'undefined'