Added some utility functions.