Updated "each" and fixed test for "indexOf"