Fix a few possible memory leaks listed on Valve wiki.