Fixed parse errors and undefined variable in foreach loop
Merge pull request #2 from mkeefe/master

Merged based on comments.