Fixing some small memleaks.