Added some new helper functions.