Added some misc functions.