Bug fix: Remove memory leaks.