Fixed some memory leakages.