Update some sql ufuncs and tests