Speculative fix to ensure correct freeing.