Improved parsing of `max_keys' field for contact search