Remove improper use of for/in, replace with for loop. Closes #111, #116