Fix last page calculation in thread lists