Src stable

Fix some bugs and add a disconnect feature.