Memory leak bugfix.