BUG: Use correct return value when ufunc loop matched