Remove dead allocation
Fix cases where variables aren't defined for all paths.