Fixed possible bug where process doesn't exit.