Corrected memory bugs.