Fix 'potentially uninitialized i' warning
Fix 'unreachable code' warning