Fix some pagination & write some tests