Cleanup terminal module.