Fixed wrong handling of value when it is null or defined