Changes to support user-defined functions.