Add empty sequence error check to max/min