Fixed up pagination problems