Fixed reconnecting issues.