Added two utility functions.