Fixed stack leaks