Added some minor changes to the ReverseFreqAlgorithm.