Fixed the algorithm that calculates tick rate to be more accurate.