Fixed a bunch of leaks to do with variable definitions.