Fixed some damn memory leaks.