Cleanup some functions.