Fix some memleaks.