Added clean up routines.