Miscallaneous shared functions which have not made it into a package yet.