Fix domain of function evaluation

Bug 2742