General analysis of instabilities in erbium-doped fiber lasers.