Added several utility functions.