Fix a few variable reassignments.
Fix uninitialized variable.