Cleanup code and memory.