Instabilities in Nonlinear-Optical Systems Due to an Abrupt Change of Parameters