Fixed port option, added a disconnect handler