Fixed crash for ''foo due to unsafe 'last'