BUG: Fixed some leaks