Fix error handling of "each"