Added files needed to be tracked. Fix a use-after-free bug and a deref-NULL bug.