This is the fix for the bug. toIndex must be the nth record after the index (n = number of records to be fetched).

i.e. Before, if fromIndex = 200 and 200 records need to be fetched, toIndex = 200 (only 1 record being fetched)
I fixed this so that toIndex = 399