Enhanced the Mapping Test to prevent undefined indices.