Fixed most of the server bugs