Fix a couple of memory leaks


There's still plenty left: https://gist.github.com/4649118