Fixed user defined functions