Fix that memory leak that I spent hours trying to find months ago and didn't succeed at.