Changes allowedUnits loop in setPosition to traditional for loop to avoid iterating over prototype properties if Array has been decorated by another framework or plugin