Fixes a possible chunk leak