Fixed broken ondisconnect code.