Bugfix: proper interval calculation