Core.Model: updated logic of function validation rule to allow custom error messages.