Cleaning up some small memory leak stuffs.