[1.3.0] Fix memory leaks