Fixed the ReverseIntervalAlgorithm and its unit tests.