Changed the for...in loops to normal for loop
Merge pull request #25 from rohilsurana/issue14

Changed the for loop in slave.js and master.js. Fixes #14