Fixed some leaks