Fixed memory bug and track toggle bug.