Topic: Topic pagination issue

There is some issue with topic pagination. Page 2 appears when there is exactly 26 posts in a topic, but all 26 posts displayed on the first page and when we click page 2 we get error message every time. Same thing happens with 51, 76 posts etc. Any suggestions? Thanks