Fixed bugs in output for frequencies.
Improved data persistence.