Fix shadowed i variable warning
Fix mutable compilation error