Memory leak fixes by Alcaro