Fix divide by zero
Fix max of possible empty sequence