Fixing pagination calc issues