Bug 959542 - Handle empty tables cleanly

Array#max can return nil

@fabianofranz review please