Add guard for empty iterables sent to max()