fixing a few issues with UDF sanitization