Trying to reduce memory leaks.