Removed redundant variable in foreach() loops.