Fix a bug that was skipping the first interval in the OPT calculations.
Add different test intervals to showcase the bug.