Working UDFs, failing test. Can't figure out why.