Fixed some chunk leakage bugs.