Fixed incorrect Client shutdown