Fixed memory leak (I think/hope)