Added manual process termination code.