Some required utility functions.