Cleaned memory leaks, code, stuff