[#15] FIx memory leaks