Sometime a sitemap contains more than $maxUrls URLs
The problem lays in flush() function.
When a sitemap is truncated by size here:
https://github.com/samdark/sitemap/blob/a7ba091766afeb5fad1ea3056b30f26c3a620962/Sitemap.php#L232
finishFile() functions is called which leads to zeroing urlsCount variable, but right after that a remaining chunk is appended to a file here (with contains up to $bufferSize URLs):
https://github.com/samdark/sitemap/blob/a7ba091766afeb5fad1ea3056b30f26c3a620962/Sitemap.php#L240
Those URLs in that chunk aren't counted anywhere and a next sitemap overflows.
Here's a sample which reproduces the problem: https://gist.github.com/DarkSilence/9c2bca943d639aae3ad995d8cf35de60
sitemap_test_4.xml should contain 100 records, but it contains 110 records.
@DarkSilence would you please convert that sample into unit test? That way we'll be sure it won't be broken again ever.