Patched memory leaks, added texture caching.