Fixed enumerable iteration

fixes issue that happens when the Array prototype has been extended (cumulative on the exception fix, sorry, forgot to create a branch before that)