Fix callbacks for disconnect

Fixes #4 and #54