BUG-4684: Add strict internal consistency checks for min/max