Plugged memory leaks - thanks Antidote!

Thanks Antidote! (https://github.com/Antidote)