Some utility functions.