Fixed memory leaks, server runs stable