Fixes to pagination with buttons