Added is_array() check to avoid errors on trash.