Yeah exactly, the count should be 19## but it's either 651 or 13## depending on the fetch order for this specific account.
I've figured it out a better way of doing this which I have got working for Paid Posts, Posts and Paid Messages. If you specify type=infinite in the query parameters you should get 50 items in a list with a bool called hasMore which will be set to true when there is still more posts after the ones returned or false when there are no more posts after the ones returned. The response also includes the value for the beforePublishDate so makes it easy to go through and get all of the posts. Its probably better than the current approach as this new way seems to consistently return 50 items whereas the current way can sometimes return different amounts even though it's half way through the amount of posts actually available which could be why it sometimes doesn't pick everything up.
You don't need to install git or download any of the code, github is simply where the code can be hosted for other people to access the program.