Fixed some stack leaks.