Fixes for Memleaks