Fixed starting a server
Code cleanup