Updated count logic
Fixes side effects of next operation
Merge pull request #199 from usergrid/USERGRID-174

Usergrid 174