Corrected invalid hit ratio calculation. Added file write of statistics.