Fixed many leaks