Fixed close function not properly setting this.client to null