Fixed termination code best we can for now.