Adjusted communication protocol to better interface with client application. Fixed various unhandled exceptions.