min-max now works properly, including end-of-data handling (VBAT-53)