fixed bug with offsets and limits.
Merge pull request #64 from Aditya-upadhyay/bugfix/offsets_and_limit

fixed bug with offsets and limits.