Bug fix for frequency_analysis