Resolved #74: fix order of min/max