Fix for-loop variable collision