Added two useful methods to utils.