I have found that the plugin does not get the parameters (page,pages).
My fix is to get these from the table itself.
I removed the parameters and added this.
var pageinfo = table.page.info();
var page = pageinfo.page;
var pages = pageinfo.pages;
Everything now works as expected.
It looks like this will apply to all the pagination plugins.
HTH
Brian