Miscellaneeous new utility functions.