Merge builtin If function (bug #3779)