fixed argument handling in user-defined functions