Need to set script inactive before removing it (Bug #13297).