Stability of solitary structures in the nonlinear Schrödinger equation