Sanity checking: max() throws error if array is empty