Corrected error and improved failure fallback for [].ancestor