Fix connection max_matches and timeout resetting
Merge branch 'v1' into v2