Added some helper functions.