Cleanups and debuging output.