Adds assertions for match errors.