Now check typeof label and value against 'undefined'

Please merge this as opposed to pull request #2824