Fix tests and match end