Fixes four small memory leaks