Did some fixes and modifications to the server code.