Better interval calculation.

Refs #117