Fixes bug where incorrect pagination values are returned