Fixed bug with closing proxy.