Miscellaneous utility functions and such.