Added null check for UDFs.