Made ESC exit a server and fixed some other bugs