[[ RefactorSyntax ]] Potential and actual memory leaks fixed