Simplified unnecessary for loop to object lookup, and fixed a missing var declaration.
Merge pull request #1 from PlNG/patch-1

Simplified unnecessary for loop to object lookup, and fixed a missing va...