Miscellaneous functions.