Fixes BatchedStore interval calculation

There was a bug in refactoring and interval calculation in BatchedStore. This fixes it and simplifies the interval math calculation. Fixes #567